package com.whcoding.designpatterns.pattern.chainofresponsibility.validate;

import com.whcoding.designpatterns.pattern.chainofresponsibility.handler.LoginHandler;
import com.whcoding.designpatterns.pattern.chainofresponsibility.vo.UserVO;

/**
 * @program: spring-boot-learning
 * @description:
 * @author: whcoding
 * @create: 2022-09-19 14:31
 **/
public class ValidateLoginHandler extends LoginHandler {

	@Override
	public void doHandler(UserVO userVO) {
		if (!"jack".equals(userVO.getUserName()) || !"666".equals(userVO.getPassword())) {
			System.out.println("用户名密码不正确");
			return;
		}
		if (null != next) {
			next.doHandler(userVO);
		}
	}

}
